import {
	http
} from '@/node_modules/uview-plus'

/**
 * @function 获取服务全部数据
 */
export const workAll = (data) => http.post('/work/all', data);

/**
 * @function 获取服务详情
 * @param id 详情id
 */
export const workDetail = (data) => http.post('/work/detail', data);

/**
 * @function 新增地址
 */
export const addressAdd = (data) => http.post('/user/address/add', data);

/**
 * @function 获取所有地址
 */
export const getAddressAll = (data) => http.post('/user/address/all', data);

/**
 * @function 删除地址
 * @param id 地址id
 */
export const postAddressDel = (data) => http.post('/user/address/del', data);

/**
 * @function 更新地址
 * @param id 地址id
 */
export const postAddressUpdate = (data) => http.post('/user/address/update', data);

/**
 * @function 获取地址详情
 * @param id 地址id
 */
export const addressDetail = (data, custom = {}) => http.post('/user/address/detail', data, {
	custom: {
		toast: false,
	}
});

/**
 * @function 获取用户信息
 */
export const getBaseInfo = (data) => http.post('/user/baseInfo', data);

/**
 * @function 修改密码
 */
export const updateLoginSecret = (data) => http.post('/user/updateLoginSecret', data);

/**
 * @function 获取用户优惠券
 */
export const getUserCouponAll = (data) => http.post('/user/userCoupon/all', data);

/**
 * @function 获取用户钱包
 */
export const balanceDetail = (data) => http.post('/user/balance/detail', data);

/**
 * @function 消费记录
 */
export const balanceLog = (data) => http.post('/user/balanceLog/pageList', data);

/**
 * @function 批量获取工人信息及其工种信息
 */
export const multiSkill = (data) => http.post('/work/worker/multiSkill', data);

/**
 * @function 获取工人
 */
export const pageListNearby = (data) => http.post('/work/worker/pageListNearby', data);

/**
 * @function 获取工人信息
 */
export const workerInfo = (data) => http.post('/work/worker/detail', data);

/**
 * @function 提交创建订单
 */
export const orderMultiCreate = (data) => http.post('/orderV2/serviceOrder/add', data);

/**
 * @function 加入购物车
 */
export const serviceCartSave = (data) => http.post('/shoppingCart/serviceCart/save', data);

/**
 * @function 获取所有购物车
 */
export const serviceCartAll = (data) => http.post('/shoppingCart/serviceCart/all', data);

/**
 * @function 移除购物车
 */
export const serviceCartDel = (data) => http.post('/shoppingCart/serviceCart/del', data);

/**
 * @function 获取所有订单列表
 */
export const orderList = (data) => http.post('/orderV2/pageList', data);

/**
 * @function 生成支付信息
 */
export const payServiceOrder = (data) => http.post('/pay/unify', data);

/**
 * @function 余额支付扣款
 */
export const userBalancePayConfirm = (data) => http.post('/pay/userBalancePayConfirm', data);

/**
 * @function 订单提交数据校验
 */
export const orderPreview = (data) => http.post('/orderV2/serviceOrder/preview', data);

/**
 * @function 获取订单详情
 */
export const orderInfo = (data) => http.post('/orderV2/detail', data);

/**
 * @function 退款验证
 */
export const refundPreview = (data) => http.post('/refund/preview', data);

/**
 * @function 退款验证
 */
export const refundAdd = (data) => http.post('/refund/add', data);


/**
 * @function 评价
 */
export const orderEvaluate = (data) => http.post('/order/serviceOrder/evaluate', data);

/**
 * @function 修改上门时间
 * @order_no 订单号
 * @new_plan_begin_at 新上门时间
 */
export const changePlanBeginAt = (data) => http.post('/order/changePlanBeginAt', data);

/**
 * @function 获取动态
 * @order_no 订单号
 * @new_plan_begin_at 新上门时间
 */
export const orderTrends = (data) => http.post('/orderV2/serviceOrderAffairs/all', data);

/**
 * @function 发布动态
 * @order_no 订单号
 * @content 内容
 * @pics 图片
 */
export const orderTrendsAdd = (data) => http.post('/orderV2/serviceOrderAffairs/add', data);

/**
 * @function 获取工人的某些工种
 * @worker_id 工人id
 */
export const workerMultiSkill = (data) => http.post('/work/worker/multiSkill', data);

/**
 * @function 获取工种
 * @work_ids 工种id
 */
export const workMulti = (data) => http.post('/work/multi', data);


/**
 * @function 获取附件的工人
 */
export const pageListNearbyV2 = (data) => http.post('/work/worker/pageListNearbyV2', data);


/**
 * @function 提交兑换码
 */
export const exchangeApi = (data) => http.post('/operation/exchangeCode/exchange', data);

/**
 * @function 兑换记录
 */
export const exchangeLogApi = (data) => http.post('/operation/exchangeLog/pageList', data);

/**
 * @function 查看自己的分销信息
 */
export const userRebateApi = (data) => http.post('/userRebate/detail', data);

/**
 * @function 查看自己的分销信息
 */
export const userRebateLog = (data) => http.post('/userRebate/userRebateLog/pageList', data);


/**
 * @function 添加收藏
 */
export const favoriteWorkerAdd = (data) => http.post('/user/favoriteWorker/add', data);

/**
 * @function 判断收藏
 */
export const favoriteWorkerCheck = (data) => http.post('/user/favoriteWorker/check', data);

/**
 * @function 取消收藏
 */
export const favoriteWorkerDel = (data) => http.post('/user/favoriteWorker/del', data);

/**
 * @function 取消收藏
 */
export const favoriteWorkerPageList = (data) => http.post('/user/favoriteWorker/pageList', data);

/**
 * @function 已邀请注册的记录
 */
export const childPageList = (data) => http.post('/userRebate/child/pageList', data);

/**
 * @function 活动详情
*/
export const activityDetail = (data) => http.post('/operation/activity/detail', data);

/**
 * @function 限时活动-用户概览
*/
export const activityOverview = (data) => http.post('/operation/activity/overview', data);

/**
 * @function 限时活动-用户概览
*/
export const activityAwardLog = (data) => http.post('/operation/activityAwardLog/pageList', data);

/**
 * @function 限时活动-参加
*/
export const activityJoin = (data) => http.post('/operation/activity/join', data);

/**
 * @function 限时活动-查询是否已经参加
*/
export const activityisJoined = (data) => http.post('/operation/activity/isJoined', data);

/**
 * @function 修改用户信息
*/
export const updateBaseInfo = (data) => http.post('/user/updateBaseInfo', data);


/**
 * @function 获取附近的工人总人数
*/
export const enableWorkerCnt = (data) => http.post('/work/worker/enableWorkerCnt', data);

/**
 * @function 限时活动-兑换
*/
export const exchange = (data) => http.post('/operation/activity/exchange', data);
